package com.lzy.cloud.job.utils;

import com.lzy.framework.core.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;

@Component
public class RemoteUtil {

    @Autowired
    private RestTemplate restTemplate;

    public String remoteJob(String serverUrl, String method) {
        String url = "http://" + StringUtil.upperCase(serverUrl) + "/" + method + "/hdghgg";
        System.out.println(url);
        String result = restTemplate.getForObject(url, String.class);
        System.out.println(result);
        return result;
    }
}
